import React,{useState} from "react";
import {Select,Input} from 'antd';
const { Search } = Input;
const { Option } = Select;
export default function SearchElement({show}) {
    let [type,setType] = useState("sort");
    const onSearch = (value) =>{
        console.log("value",type,value);
        show({type,value});
    }
    const handleChange = (type) => {
        console.log(type);
        setType(type);
    }
    return (
        <div>
            <Select
                defaultValue="sort"
                onChange={handleChange}
                style={{ width: 80 }}
            >
                <Option value="sort">类型</Option>

            </Select>
            <Search
                style={{ width: 400 }}
                placeholder="input search text"
                onSearch={onSearch}
                enterButton
            />
        </div>
    );
}